[xiph-cvs] cvs commit: m4 xiph_curl.m4

Karl Heyes karl at xiph.org
Wed Jul 23 19:31:36 PDT 2003



karl        03/07/23 22:31:36

  Modified:    .        configure.in
               .        xiph_curl.m4
  Log:
  remove duplication for compiler flags, and fixup curl detection

Revision  Changes    Path
1.36      +32 -59    icecast/configure.in

Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/icecast/configure.in,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- configure.in	21 Jul 2003 02:23:41 -0000	1.35
+++ configure.in	24 Jul 2003 02:31:36 -0000	1.36
@@ -1,5 +1,5 @@
 AC_INIT(src/main.c)
-AC_PREREQ(2.50)
+AC_PREREQ(2.54)
 dnl Process this file with autoconf to produce a configure script.
 
 AM_INIT_AUTOMAKE(icecast,2.0-alpha-2)
@@ -12,56 +12,35 @@
 dnl Set some options based on environment
 
 case "$host" in
-    *openbsd*)
+    *openbsd* | *irix*)
     ;;
     *) AC_DEFINE(_XOPEN_SOURCE, 600, [Define if you have POSIX and XPG specifications])
     ;;
 esac
+DEBUG="-g"
 if test -z "$GCC"; then
+    XIPH_CPPFLAGS="-D_REENTRANT"
     case $host in 
         *-*-irix*)
-                DEBUG="-g -signed -D_REENTRANT" 
-                XIPH_CFLAGS="-O2 -w -signed -D_REENTRANT"
+                XIPH_CPPFLAGS="$XIPH_CPPFLAGS -w -signed"
                 PROFILE="-p -g3 -O2 -signed -D_REENTRANT"
                 ;;
         *-*-solaris*)
-                DEBUG="-v -g -D_REENTRANT"
-                XIPH_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92 -D_REENTRANT"
-                PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc -D_REENTRANT"
+                XIPH_CFLAGS="-xO4 -xcg92"
+                XIPH_CPPFLAGS="$XIPH_CPPFLAGS -v -w -fsimple -fast"
+                PROFILE="-xpg -g -Dsuncc"
                 ;;
         *)
-                DEBUG="-g -D_REENTRANT"
-                XIPH_CFLAGS="-O -D_REENTRANT"
-                PROFILE="-g -p -D_REENTRANT"
+                XIPH_CFLAGS="-O"
+                PROFILE="-g -p"
                 ;;
     esac
 else
+    XIPH_CPPFLAGS="-Wall -ffast-math -fsigned-char"
+    PROFILE="-pg -g"
     case $host in 
-        *-*-linux*)
-                DEBUG="-g -Wall -fsigned-char -D_GNU_SOURCE"
-                XIPH_CPPFLAGS="-ffast-math -fsigned-char -D_GNU_SOURCE"
-                PROFILE="-Wall -W -pg -g -ffast-math -fsigned-char -D_GNU_SOURCE"
-                ;;
-        sparc-sun-solaris*)
+        *-solaris*)
                 AC_DEFINE(__EXTENSIONS__, 1, [define to 1 to get resolve header problem on solaris])
-                DEBUG="-g -Wall -fsigned-char -mv8"
-                XIPH_CPPFLAGS="-ffast-math -fsigned-char -mv8"
-                PROFILE="-pg -g -fsigned-char -mv8" 
-                ;;
-        *-pc-solaris*)
-                DEBUG="-g -Wall -fsigned-char"
-                XIPH_CPPFLAGS="-ffast-math -fsigned-char"
-                PROFILE="-pg -g -fsigned-char" 
-                ;;
-        *freebsd*)
-                DEBUG="-g -Wall -fsigned-char"
-                XIPH_CPPFLAGS="-fsigned-char"
-                PROFILE="-g -pg -fsigned-char" 
-                ;;
-        *)
-                DEBUG="-g -Wall -fsigned-char"
-                XIPH_CPPFLAGS="-Wall -fsigned-char"
-                PROFILE="-g -pg -Wall -fsigned-char" 
                 ;;
     esac
 fi
@@ -100,33 +79,24 @@
 XIPH_VAR_PREPEND([XIPH_LIBS],[$PTHREAD_LIBS])
 
 dnl -- YP support --
-AC_ARG_ENABLE([yp],
-        AC_HELP_STRING([--disable-yp],[disable YP directory support]))
-if test "x$enable_yp" != "xno"
+AC_ARG_ENABLE([yp], AC_HELP_STRING([--disable-yp],[disable YP directory support]),,
+        [enable_yp="yes"])
+if test "x$enable_yp" = "xyes"
 then
 XIPH_PATH_CURL([
-  AC_CHECK_DECL([CURLOPT_NOSIGNAL], [
-    AC_DEFINE([USE_YP], 1, [Define to compile in YP support code])
-    ICECAST_OPTIONAL="$ICECAST_OPTIONAL geturl.o yp.o"
-    ], [
-    if test "x$enable_yp" != "xyes"
-    then
-      AC_MSG_NOTICE([Your curl dev files are too old (7.10 or above required), YP disabled])
-    else
-      AC_MSG_ERROR([Your curl dev files are too old (7.10 or above required)])
-    fi
-    ], [#include <curl/curl.h>])
-  ], [
-  if test "x$enable_yp" != "xyes"
-  then
-    AC_MSG_NOTICE([libcurl not found, YP disabled])
-  else
-    AC_MSG_ERROR([libcurl not found])
-  fi
-  ])
+    AC_CHECK_DECL([CURLOPT_NOSIGNAL],
+        [ AC_DEFINE([USE_YP], 1, [Define to compile in YP support code])
+        ICECAST_OPTIONAL="$ICECAST_OPTIONAL geturl.o yp.o"
+        XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$CURL_CFLAGS])
+        XIPH_VAR_PREPEND([XIPH_LIBS],[$CURL_LIBS])
+        ], [ AC_MSG_NOTICE([Your curl dev files are too old (7.10 or above required), YP disabled])
+        ], [#include <curl/curl.h>
+        ])
+    ],[ AC_MSG_NOTICE([libcurl not found, YP disabled])
+    ])
+else
+    AC_MSG_NOTICE([YP support disabled])
 fi
-XIPH_VAR_APPEND([XIPH_CFLAGS],[$CURL_CFLAGS])
-XIPH_VAR_PREPEND([XIPH_LIBS],[$CURL_LIBS])
 
 dnl Make substitutions
 
@@ -143,4 +113,7 @@
 AC_SUBST(PROFILE)
 AC_SUBST(ICECAST_OPTIONAL)
 
-AC_OUTPUT(Makefile conf/Makefile src/Makefile src/avl/Makefile src/httpp/Makefile src/thread/Makefile src/log/Makefile src/net/Makefile src/timing/Makefile doc/Makefile web/Makefile admin/Makefile win32/Makefile win32/res/Makefile)
+AC_OUTPUT([Makefile conf/Makefile src/Makefile src/avl/Makefile
+src/httpp/Makefile src/thread/Makefile src/log/Makefile
+src/net/Makefile src/timing/Makefile doc/Makefile web/Makefile
+admin/Makefile win32/Makefile win32/res/Makefile])

<p><p>1.3       +8 -4      m4/xiph_curl.m4

Index: xiph_curl.m4
===================================================================
RCS file: /usr/local/cvsroot/m4/xiph_curl.m4,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- xiph_curl.m4	21 Jul 2003 17:33:03 -0000	1.2
+++ xiph_curl.m4	24 Jul 2003 02:31:36 -0000	1.3
@@ -22,11 +22,13 @@
     CURL_LIBS="$($CURL_CONFIG --libs)"
     CURL_CFLAGS="$($CURL_CONFIG --cflags)"
 else
-    if test "x$prefix" != "xNONE"; then
-        CURL_LIBS="-L$prefix/lib"
-        CURL_CFLAGS="-I$prefix/include"
+    if test "x$prefix" = "xNONE"; then
+        curl_prefix="/usr/local"
+    else
+        curl_prefix="$prefix"
     fi
-    CURL_LIBS="$CURL_LIBS -lcurl"
+    CURL_LIBS="-L$curl_prefix/lib -lcurl"
+    CURL_CFLAGS="-I$curl_prefix/include"
 fi
 
 curl_ok="yes"
@@ -58,6 +60,8 @@
     ifelse([$1], , :, [$1])     
 else
     AC_MSG_RESULT(no)
+    CURL_LIBS=""
+    CURL_CFLAGS=""
     ifelse([$2], , :, [$2])
 fi
 ])

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list