aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in81
1 files changed, 81 insertions, 0 deletions
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000..0c405fb
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,81 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(tkRadar.c)
+
+dnl builtin([include],acplcaux.m4)
+#
+# This one is for testing purposes
+#
+dnl ac_compile='echo ${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS; ${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS'
+dnl ac_link='echo ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS; ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS'
+
+AC_CONFIG_HEADER(config.h)
+
+AC_PROG_CC
+dnl for shared library stuff
+# extract version information
+XRADAR_VER=`sed -n -e 's/#define XRADARVER.*\([0-9]\)$/\1/p' patchlvl.h`
+XRADAR_MAJOR=`sed -n -e 's/#define XRADARREV.*\([0-9]\)$/\1/p' patchlvl.h`
+XRADAR_VERSION=`sed -n -e 's/#define XRADARVERSION.*\([0-9][a-z][0-9]\).*/\1/p' patchlvl.h`
+AC_SUBST(XRADAR_VER)
+AC_SUBST(XRADAR_MAJOR)
+AC_SUBST(XRADAR_VERSION)
+
+builtin([include],acaux.m4)
+AC_SYS_SHAREDLIB
+
+AC_PROG_INSTALL
+AC_PROG_CPP
+AC_PROG_RANLIB
+AC_ISC_POSIX
+AC_STDC_HEADERS
+AC_CHECK_HEADERS(values.h stddef.h stdarg.h limits.h strings.h string.h)
+AC_CHECK_HEADERS(unistd.h memory.h stdlib.h)
+AC_CHECK_HEADERS(sys/types.h sys/time.h sys/timeb.h sys/times.h)
+AC_CHECK_FUNCS(gettimeofday)
+
+
+AC_PATH_XTRA
+
+#
+# Add any user supplied library directories to the X flags
+#
+ac_setup_local_x_libs_msg="Add the correct path to LOCAL_X_LIBS,"
+ac_retry_msg="and run configure again."
+test -n "$LOCAL_X_LIBS" && LOCAL_X_LIBS="-L$LOCAL_X_LIBS"
+
+#
+# We need to setup CFLAGS to suppress -g flags which will prevent the linker
+# from finding the libraries.
+# We need to setup LDFLAGS to add the libraries paths.
+#
+TMP_LDFLAGS=$LDFLAGS
+TMP_CFLAGS=$CFLAGS
+TMP_LIBS=$LIBS
+LDFLAGS="$LDFLAGS $X_LIBS $LOCAL_X_LIBS"
+CFLAGS=""
+LIBS="-lX11 $X_EXTRA_LIBS"
+this_is_not_ok=""
+XPM=""
+AC_CHECK_LIB(Xpm, main,
+ [XPM="-lXpm"],
+ [echo "-lXpm not found,"
+ echo $ac_setup_local_x_libs_msg
+ echo $ac_retry_msg
+ this_is_not_ok="1"])
+TMP_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS -I $x_includes"
+AC_CHECK_HEADERS(X11/xpm.h)
+CPPFLAGS=$TMP_CPPFLAGS
+
+LIBS="-lXext -lX11 $X_EXTRA_LIBS"
+
+AC_CONST
+AC_MINUS_C_MINUS_O
+
+AC_SUBST(XPM)
+AC_SUBST(XMU)
+AC_SUBST(LOCAL_X_LIBS)
+AC_SUBST(CFLAGS)
+AC_SUBST(LDFLAGS)
+
+AC_OUTPUT(Makefile)