tatsuhiro-t / spdylay

The experimental SPDY protocol version 2, 3 and 3.1 implementation in C
http://tatsuhiro-t.github.io/spdylay/
MIT License
603 stars 102 forks source link

Make the nurses library check a runtime check #9

Closed sorced-jim closed 12 years ago

sorced-jim commented 12 years ago

Feel free to move this check into a darwin specific block to make cross compiling easier.

tatsuhiro-t commented 12 years ago

2012/02/10 3:57 "sorced-jim" < reply@reply.github.com

:

Feel free to move this check into a darwin specific block to make cross compiling easier.

Does AC_SEARCH_LIBS not work on Mac OS X?

Best regards,

Tatsuhiro Tsujikawa

You can merge this Pull Request by running:

git pull https://github.com/sorced-jim/spdylay master

Or you can view, comment on it, or merge it online at:

https://github.com/tatsuhiro-t/spdylay/pull/9

-- Commit Summary --

  • Make the ncurses check a runtime check

-- File Changes --

M configure.ac (8)

-- Patch Links --

https://github.com/tatsuhiro-t/spdylay/pull/9.patch https://github.com/tatsuhiro-t/spdylay/pull/9.diff


Reply to this email directly or view it on GitHub: https://github.com/tatsuhiro-t/spdylay/pull/9 2012/02/10 3:57 "sorced-jim" < reply@reply.github.com :

Feel free to move this check into a darwin specific block to make cross compiling easier.

You can merge this Pull Request by running:

git pull https://github.com/sorced-jim/spdylay master

Or you can view, comment on it, or merge it online at:

https://github.com/tatsuhiro-t/spdylay/pull/9

-- Commit Summary --

  • Make the ncurses check a runtime check

-- File Changes --

M configure.ac (8)

-- Patch Links --

https://github.com/tatsuhiro-t/spdylay/pull/9.patch https://github.com/tatsuhiro-t/spdylay/pull/9.diff


Reply to this email directly or view it on GitHub: https://github.com/tatsuhiro-t/spdylay/pull/9

sorced-jim commented 12 years ago

Sure it works. It checks that the code links. The problem with cunit on mac os x 10.6 and up is that code links with cunit but doesn't run.

On Thu, Feb 9, 2012 at 11:43 PM, Tatsuhiro Tsujikawa < reply@reply.github.com

wrote:

2012/02/10 3:57 "sorced-jim" < reply@reply.github.com

:

Feel free to move this check into a darwin specific block to make cross compiling easier.

Does AC_SEARCH_LIBS not work on Mac OS X?

Best regards,

Tatsuhiro Tsujikawa

You can merge this Pull Request by running:

git pull https://github.com/sorced-jim/spdylay master

Or you can view, comment on it, or merge it online at:

https://github.com/tatsuhiro-t/spdylay/pull/9

-- Commit Summary --

  • Make the ncurses check a runtime check

-- File Changes --

M configure.ac (8)

-- Patch Links --

https://github.com/tatsuhiro-t/spdylay/pull/9.patch https://github.com/tatsuhiro-t/spdylay/pull/9.diff


Reply to this email directly or view it on GitHub: https://github.com/tatsuhiro-t/spdylay/pull/9 2012/02/10 3:57 "sorced-jim" < reply@reply.github.com :

Feel free to move this check into a darwin specific block to make cross compiling easier.

You can merge this Pull Request by running:

git pull https://github.com/sorced-jim/spdylay master

Or you can view, comment on it, or merge it online at:

https://github.com/tatsuhiro-t/spdylay/pull/9

-- Commit Summary --

  • Make the ncurses check a runtime check

-- File Changes --

M configure.ac (8)

-- Patch Links --

https://github.com/tatsuhiro-t/spdylay/pull/9.patch https://github.com/tatsuhiro-t/spdylay/pull/9.diff


Reply to this email directly or view it on GitHub: https://github.com/tatsuhiro-t/spdylay/pull/9


Reply to this email directly or view it on GitHub: https://github.com/tatsuhiro-t/spdylay/pull/9#issuecomment-3902433

Jim https://twitter.com/#!/sorced_eng

tatsuhiro-t commented 12 years ago

I see. As you wrote, runtime check is not easy for cross compiling. Do you know how to isolate this to only applicable to Mac OS X?

I also think this -lncurses check is solely Mac OS X only at the moment, so instead of doing elaborate runtime check, we can just add -lncurses to CUNIT_LIBS when compiled on Mac OS X.

tatsuhiro-t commented 12 years ago

Something like this?

diff --git a/configure.ac b/configure.ac
index 61509a3..57abf03 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,14 +66,15 @@ if test "x${have_cunit}" = "xno"; then
   fi
 fi
 if test "x${have_cunit}" = "xyes"; then
-  # Check whether the installed cunit requires ncurses.  This is
-  # needed because cunit in Mac OS X requires it.
-  LIBS_TEMP=${LIBS}
-  LIBS=${CUNIT_LIBS}
-  AC_SEARCH_LIBS([CU_initialize_registry], [ncurses])
-  CUNIT_LIBS=${LIBS}
-  AC_SUBST([CUNIT_LIBS])
-  LIBS=${LIBS_TEMP}
+  # cunit in Mac OS X requires ncurses. Note that in Mac OS X, test
+  # program can be built without -lncurses, but it emits runtime
+  # error.
+  case "${build}" in
+    *-apple-darwin)
+      CUNIT_LIBS="$CUNIT_LIBS -lncurses"
+      AC_SUBST([CUNIT_LIBS])
+      ;;
+  esac
 fi

 AM_CONDITIONAL([HAVE_CUNIT], [ test "x${have_cunit}" = "xyes" ])
sorced-jim commented 12 years ago

-apple-darwin, but yes, that check works.

On Sun, Feb 12, 2012 at 12:16 AM, Tatsuhiro Tsujikawa < reply@reply.github.com

wrote:

Something like this?

diff --git a/configure.ac b/configure.ac
index 61509a3..57abf03 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,14 +66,15 @@ if test "x${have_cunit}" = "xno"; then
  fi
 fi
 if test "x${have_cunit}" = "xyes"; then
-  # Check whether the installed cunit requires ncurses.  This is
-  # needed because cunit in Mac OS X requires it.
-  LIBS_TEMP=${LIBS}
-  LIBS=${CUNIT_LIBS}
-  AC_SEARCH_LIBS([CU_initialize_registry], [ncurses])
-  CUNIT_LIBS=${LIBS}
-  AC_SUBST([CUNIT_LIBS])
-  LIBS=${LIBS_TEMP}
+  # cunit in Mac OS X requires ncurses. Note that in Mac OS X, test
+  # program can be built without -lncurses, but it emits runtime
+  # error.
+  case "${build}" in
+    *-apple-darwin)
+      CUNIT_LIBS="$CUNIT_LIBS -lncurses"
+      AC_SUBST([CUNIT_LIBS])
+      ;;
+  esac
 fi

 AM_CONDITIONAL([HAVE_CUNIT], [ test "x${have_cunit}" = "xyes" ])

Reply to this email directly or view it on GitHub: https://github.com/tatsuhiro-t/spdylay/pull/9#issuecomment-3926388

Jim https://twitter.com/#!/sorced_eng

sorced-jim commented 12 years ago

I'm not too worried about cross compiling, since the tests would need to run in the cross compiled environment.

On Mon, Feb 13, 2012 at 9:29 AM, James Morrison jim@sorced.com wrote:

-apple-darwin, but yes, that check works.

On Sun, Feb 12, 2012 at 12:16 AM, Tatsuhiro Tsujikawa < reply@reply.github.com

wrote:

Something like this?

diff --git a/configure.ac b/configure.ac
index 61509a3..57abf03 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,14 +66,15 @@ if test "x${have_cunit}" = "xno"; then
  fi
 fi
 if test "x${have_cunit}" = "xyes"; then
-  # Check whether the installed cunit requires ncurses.  This is
-  # needed because cunit in Mac OS X requires it.
-  LIBS_TEMP=${LIBS}
-  LIBS=${CUNIT_LIBS}
-  AC_SEARCH_LIBS([CU_initialize_registry], [ncurses])
-  CUNIT_LIBS=${LIBS}
-  AC_SUBST([CUNIT_LIBS])
-  LIBS=${LIBS_TEMP}
+  # cunit in Mac OS X requires ncurses. Note that in Mac OS X, test
+  # program can be built without -lncurses, but it emits runtime
+  # error.
+  case "${build}" in
+    *-apple-darwin)
+      CUNIT_LIBS="$CUNIT_LIBS -lncurses"
+      AC_SUBST([CUNIT_LIBS])
+      ;;
+  esac
 fi

 AM_CONDITIONAL([HAVE_CUNIT], [ test "x${have_cunit}" = "xyes" ])

Reply to this email directly or view it on GitHub: https://github.com/tatsuhiro-t/spdylay/pull/9#issuecomment-3926388

Jim https://twitter.com/#!/sorced_eng

Jim https://twitter.com/#!/sorced_eng

tatsuhiro-t commented 12 years ago

Hi,

2012年2月14日2:32 sorced-jim reply@reply.github.com:

I'm not too worried about cross compiling, since the tests would need to run in the cross compiled environment.

I agree. I just want simpler solution.

On Mon, Feb 13, 2012 at 9:29 AM, James Morrison jim@sorced.com wrote:

-apple-darwin, but yes, that check works.

Thanks. I'll use it.

Best regards,

Tatsuhiro Tsujikawa

On Sun, Feb 12, 2012 at 12:16 AM, Tatsuhiro Tsujikawa < reply@reply.github.com

wrote:

Something like this?

diff --git a/configure.ac b/configure.ac
index 61509a3..57abf03 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,14 +66,15 @@ if test "x${have_cunit}" = "xno"; then
  fi
 fi
 if test "x${have_cunit}" = "xyes"; then
-  # Check whether the installed cunit requires ncurses.  This is
-  # needed because cunit in Mac OS X requires it.
-  LIBS_TEMP=${LIBS}
-  LIBS=${CUNIT_LIBS}
-  AC_SEARCH_LIBS([CU_initialize_registry], [ncurses])
-  CUNIT_LIBS=${LIBS}
-  AC_SUBST([CUNIT_LIBS])
-  LIBS=${LIBS_TEMP}
+  # cunit in Mac OS X requires ncurses. Note that in Mac OS X, test
+  # program can be built without -lncurses, but it emits runtime
+  # error.
+  case "${build}" in
+    *-apple-darwin)
+      CUNIT_LIBS="$CUNIT_LIBS -lncurses"
+      AC_SUBST([CUNIT_LIBS])
+      ;;
+  esac
 fi

 AM_CONDITIONAL([HAVE_CUNIT], [ test "x${have_cunit}" = "xyes" ])

Reply to this email directly or view it on GitHub: https://github.com/tatsuhiro-t/spdylay/pull/9#issuecomment-3926388

Jim https://twitter.com/#!/sorced_eng

Jim https://twitter.com/#!/sorced_eng


Reply to this email directly or view it on GitHub: https://github.com/tatsuhiro-t/spdylay/pull/9#issuecomment-3944790

tatsuhiro-t commented 12 years ago

I merged 69dc06f. For configure.ac, I choose my idea.