Skip to content
Snippets Groups Projects
Commit b5178411 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

everything works with autotools.

however, libxml2 idiosyncratic location of include's breaks portability
parent 8adb8d61
No related branches found
No related tags found
No related merge requests found
###############################################################################
## FRIDA: fast reliable interactive data analysis ##
## configure.ac: used by 'autoreconf -i' to prepare for 'configure' ##
## (C) Joachim Wuttke, Sebastian Busch 2008- ##
## http://frida.sourceforge.net ##
###############################################################################
###############################################################################
## Generic initialization ##
###############################################################################
AC_INIT([frida], [2], [j.wuttke@fz-juelich.de])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([src/frida2.cpp]) # check if src directory contains the specified file to assure it really contains the sources
AC_CONFIG_SRCDIR([src/frida2.cpp]) # assure we have the right src dir
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
###############################################################################
## Select compiler and related tools ##
###############################################################################
AC_PROG_LIBTOOL
AC_PROG_CXX
AC_PROG_LEX # if flex is found, set LEX to "flex" and LEXLIB to "-lfl". otherwise to "lex" and "-ll". there is also a AM_PROG_LEX
AC_PROG_LEX # LEX,LEXLIB = "flex","-lfl" or "lex","-ll"
if test "$LEX" = :; then
AC_MSG_ERROR([Cannot find lex. Aborting.])
fi
# AC_PROG_LN_S
AC_PROG_YACC # if bison is found, set YACC to "bison -y". otherwise, if byacc is found, set to "byacc". otherwise, set to "yacc"
AC_PROG_YACC # YACC = "bison -y" or "byacc" or "yacc"
if test "$YACC" = "yacc"; then
AC_MSG_ERROR([Cannot find yacc. Aborting.])
fi
AC_CHECK_PROGS([GNUPLOT], [gnuplot], [:]) # self-made after tar-example
if test "$GNUPLOT" = :; then
AC_MSG_ERROR([Cannot find gnuplot. Aborting.])
fi
AC_CHECK_LIB([fftw3], [fftw_plan_r2r_1d], , [AC_MSG_ERROR(fftw_plan_r2r_1d() not found)])
## gsl, taken from http://www.gnu.org/software/gsl/manual/html_node/Autoconf-Macros.html
AC_CHECK_LIB([m], [cos], , [AC_MSG_ERROR(cos() not found)])
AC_CHECK_LIB([gslcblas], [cblas_dgemm], , [AC_MSG_ERROR(cblas_dgemm() not found)])
AC_CHECK_LIB([gsl], [gsl_blas_dgemm], , [AC_MSG_ERROR(gsl_blas_dgemm() not found)])
## history
AC_CHECK_LIB([history], [using_history], , [AC_MSG_ERROR(using_history() not found)])
## ncurses
AC_CHECK_LIB([ncurses], [initscr], , [AC_MSG_ERROR(initscr() not found)])
###############################################################################
## Check for libraries, headers, defs needed at build time ##
###############################################################################
## readline
AC_CHECK_LIB([readline], [readline], , [AC_MSG_ERROR(readline() not found)])
AC_CHECK_LIB([fftw3], [fftw_plan_r2r_1d], ,
[AC_MSG_ERROR(libfftw not found or out of sync)])
## xml2 -- will be abolished soon
CPPFLAGS="$CPPFLAGS -I/usr/include/libxml2"
AC_CHECK_LIB([xml2], [xmlParseFile], , [AC_MSG_ERROR(xmlParseFile() not found)])
AC_CHECK_LIB([m], [cos], ,
[AC_MSG_ERROR(libm not found or corrupted)])
AC_CHECK_LIB([gslcblas], [cblas_dgemm], ,
[AC_MSG_ERROR(libgslcblas not found or out of sync)])
AC_CHECK_LIB([gsl], [gsl_blas_dgemm], ,
[AC_MSG_ERROR(libgsl not found or out of sync)])
AC_CHECK_LIB([readline], [readline], ,
[AC_MSG_ERROR(libreadline not found or corrupted)])
AC_CHECK_LIB([history], [using_history], ,
[AC_MSG_ERROR(libhistory not found or corrupted)])
# AC_CHECK_LIB([ncurses], [initscr], , [AC_MSG_ERROR(initscr() not found)]
AC_CHECK_LIB([yaml], [yaml_parser_set_input_file], ,
[AC_MSG_ERROR(libyaml not found por out of sync)])
## lmmin
#CPPFLAGS="$CPPFLAGS -I../lmfit" # think we don't need that
#AC_CHECK_FILE([lmfit/lmmin.c], LIBS="$LIBS -L../lmfit -llmmin", AC_CHECK_FILE([../lmfit/lmmin.c], LIBS="$LIBS -L../../lmfit -llmmin", [AC_MSG_ERROR(lmfit/lmmin.c not found)]))
## yaml
# AC_CHECK_FILE([yaml/src/api.c], LIBS="$LIBS -L../yaml/src -lyaml", [AC_MSG_ERROR(yaml/src/api.c not found)])
# xml2 (obsolescent, used for old SPHERES data)
AC_CHECK_LIB([xml2], [xmlParseFile], ,
[AC_MSG_ERROR(libxml2 not found or corrupted)])
AC_CHECK_LIB([lmmin], [lm_minimize], ,
[AC_MSG_ERROR(liblmmin not found por out of sync)])
# Checks for header files
## I put this one here only because qmake does: Make sure off_t is 64-bit in *nix, taken from http://www.google.com/search?q=cache:wlNJ8Qe4dBgJ:www.sfr-fresh.com/unix/privat/libfb-v0.18.4b-src.zip:a/src/rtlib/configure.ac+configure.ac+file+offset+bits&hl=de&ct=clnk&cd=5&gl=de&client=firefox-a
......@@ -54,7 +65,6 @@ AC_FUNC_ALLOCA
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h inttypes.h libintl.h malloc.h stddef.h stdlib.h string.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics
AC_HEADER_STDBOOL
AC_C_CONST
......@@ -76,8 +86,24 @@ AC_FUNC_REALLOC
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([floor gettimeofday memset mkfifo modf pow sqrt strchr strspn])
# Output files
# AC_CONFIG_HEADERS([config.h]) # declare output config header
AC_CONFIG_FILES([Makefile src/Makefile]) # declare output Makefiles
# AC_CONFIG_SUBDIRS([lmfit yaml]) # call their ./configure script recursively
###############################################################################
## Check for facilities needed at run time ##
###############################################################################
AC_CHECK_PROGS([GNUPLOT], [gnuplot], [:])
if test "$GNUPLOT" = :; then
AC_MSG_ERROR([Cannot find gnuplot. Aborting.])
fi
###############################################################################
## Files needed at run time ##
###############################################################################
datadir = @datarootdir@/frida2
###############################################################################
## Execute ##
###############################################################################
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT
/home/jwu/code/kww/pub
\ No newline at end of file
/home/jwu/code/lmfit/pub
\ No newline at end of file
\d psdir ~/gnew/
\d pshead ~/gcode/g3.ps
\d psdict ~/gcode/wups07a.ps
\d cv_mode -1
\d cv_epsabs 1e-8
\d cv_epsrel 1e-8
\ No newline at end of file
File moved
File moved
BUILT_SOURCES = xax_yacc.h # otherwise we cannot include it into flex
AM_YFLAGS = -d -p xax # options passed to yacc
AM_LFLAGS = -Pxax -olex.yy.c # options passed to lex
AM_CFLAGS = -I$(srcdir)/../lib
AM_CXXFLAGS = -I/usr/include/libxml2
bin_PROGRAMS = frida2
#frida2_SOURCES = `ls *.cpp *.h *.y *.l`
frida2_SOURCES = asi.cpp \
asi.h \
coord.cpp \
......
......@@ -5,9 +5,10 @@
//* http://frida.sourceforge.net *//
//**************************************************************************//
#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <lmmin.h>
using namespace std;
#include "mystd.h"
......@@ -15,7 +16,6 @@ using namespace std;
#include "expr.h"
#include "readln.h"
#include "asi.h"
#include "../lmfit/lib/lmmin.h"
#include "xax_lex.h"
//! local functions (wouldn't suffice "static" ??)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment