From: Mazet Laurent Date: Thu, 27 Nov 2025 16:17:13 +0000 (+0100) Subject: change configure input name X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=476b94099009c8ca3a7cfa8a32236c858462718e;p=libviterbi.git change configure input name --- diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..9690212 --- /dev/null +++ b/configure.ac @@ -0,0 +1,266 @@ +dnl Process this file with autoconf to produce a configure script. + +AC_INIT(src/trellis.h) + +AC_CANONICAL_HOST + +dnl Generate config.h + +dnl Minimum Autoconf version required. +AC_PREREQ(2.10) + +dnl Version code +V_MAJOR=1 +V_MINOR=2 +V_MICRO=0 + +VERSION=${V_MAJOR}.${V_MINOR}.${V_MICRO} +AC_SUBST(VERSION) + +dnl Package name +PACKAGE=viterbi +AC_SUBST(PACKAGE) + +dnl Library name +LIBRARY=viterbi +AC_SUBST(LIBRARY) + +dnl Check C compiler + +AC_PROG_CC + +dnl Check compileur options + +OLDCCFLAGS="$CCFLAGS" +CCFLAGS="" +LIBVITERBI_CC_FLAG(-O3) +if test "$libviterbi_cv_cc_flag__O3" = "no"; then + LIBVITERBI_CC_FLAG(-O2) + if test "$libviterbi_cv_cc_flag__O2" = "no"; then + CCFLAGS="$OLDCCFLAGS" + fi +fi + +LIBVITERBI_CC_FLAG(-pipe) + +LIBVITERBI_CC_FLAG(-Wall) + +dnl Checks for programs. + +AC_PROG_INSTALL +AC_PROG_MAKE_SET +AC_PROG_LN_S +AC_PROG_RANLIB + +AC_CHECK_PROGS(AR, ar) +if test "$AR" = ""; then + if $STATIC_LIBS; then + AC_MSG_ERROR([Unable to found ar]); + fi +fi +AC_SUBST(AR) + +AC_CHECK_PROGS(STRIP, strip) +if test "$STRIP" = ""; then + AC_MSG_WARN([Unable to found strip]); +fi +AC_SUBST(STRIP) + +AC_CHECK_PROGS(BASENAME, basename) +if test "$BASENAME" = ""; then + AC_MSG_ERROR([Unable to found basename]); +fi +AC_SUBST(BASENAME) + +AC_CHECK_PROGS(TAR, gtar tar) +if test -z "$TAR"; then + AC_MSG_WARN([Unable to found tar]); +fi +AC_SUBST(TAR) + +AC_CHECK_PROGS(COMPRESS, bzip2 gzip compress) +if test -z "$COMPRESS"; then + AC_MSG_WARN([Unable to found compress]); +fi +AC_SUBST(COMPRESS) + +dnl Checks for libraries. + +dnl Checks for header files. + +dnl Checks for typedefs, structures, and compiler characteristics. + +dnl Check options + +### Usage of a temporary directory + +BUILD_DIR="build" +AC_ARG_ENABLE(builddir, + [ --enable-builddir= use for object files], + [case "$enableval" in + no) + ;; + yes) + BUILD_DIR="/tmp/`whoami`/$PACKAGE" + ;; + *) + BUILD_DIR="$enableval" + ;; + esac], []) +changequote(,)dnl +BUILD_DIR=`echo $BUILD_DIR | sed -e 's%^\([^/]\)%$(top_srcdir)/\1%'` +changequote([,])dnl +AC_SUBST(BUILD_DIR) + +### Enable creation of static libraries. + +AC_ARG_ENABLE(static, + [ --enable-static create static libraries], + [if test "$enableval" = no; then STATIC_LIBS=false; + else STATIC_LIBS=true; fi], + STATIC_LIBS=true) +AC_SUBST(STATIC_LIBS) + +### enable debugging information + +AC_ARG_WITH(debug, + [ --with-debug add debug information], + [if test "$withval" = no; then DEBUG=false; + else DEBUG=true; fi], + DEBUG=false) +AC_SUBST(DEBUG) + +### with profiling information + +AC_ARG_WITH(profile, + [ --with-profile add profiling information (for gprof)], + [if test "$withval" = no; then PROFILE=false; + else PROFILE=true; fi], + PROFILE=false) + +if test "$PROFILE" = true; then + DEBUG=true +fi + +## check debugging flags + +if test "$DEBUG" = true; then + LIBVITERBI_CC_FLAG(-ggdb3) + if test "$libviterbi_cv_cc_flag__ggdb3" = "no"; then + LIBVITERBI_CC_FLAG(-g) + if test "$libviterbi_cv_cc_flag__g" = "no"; then + AC_MSG_ERROR([Can't add debugging information with this compiler!]) + fi + fi +fi + +## check profiling flags + +if test "$PROFILE" = true; then + LIBVITERBI_CC_LDFLAG(-pg) + if test "$libviterbi_cv_cc_ldflag__pg" = "no"; then + AC_MSG_ERROR([Can't add profiling information with this compiler!]) + fi +fi + +### Enable creation of shared libraries. Currently only works with +### gcc on some systems. + +AC_ARG_ENABLE(shared, + [ --enable-shared create shared libraries (not all systems)], + [if test "$enableval" = no; then SHARED_LIBS=false; + else SHARED_LIBS=true; fi], + SHARED_LIBS=true) +AC_SUBST(SHARED_LIBS) + +dnl Some check for cygwin + +case "$host" in + *-*-cygwin*) + SHARED_LIBS=false + ;; +esac + +if $STATIC_LIBS || $SHARED_LIBS; then + true +else + AC_MSG_ERROR([You can't disable building static AND shared libraries!]) +fi + +### + +use_rpath=true +AC_ARG_ENABLE(rpath, + [ --enable-rpath add -rpath to link command for shared libraries], + [if test "$enableval" = no; then use_rpath=false; fi], []) + +CCPICFLAG=-fPIC +SHLEXT=so +STLEXT=a +SH_LD="$CC" +SH_LDFLAGS=-shared +SONAME_FLAGS= +RLD_FLAG= +EXECEXT="" +case "$host" in + *-*-386bsd* | *-*-openbsd* | *-*-netbsd* | *-*-freebsd*) + SH_LD=ld + SH_LDFLAGS=-Bshareable + ;; + *-*-cygwin*) + EXECEXT=".exe" + ;; + *-*-linux*) + SONAME_FLAGS='-Xlinker -soname -Xlinker $(shell $(BASENAME) $@)' + RLD_FLAG='-Xlinker -rpath -Xlinker $(shell cd $(LIB_BUILD_DIR); pwd)' + ;; + hppa*-hp-hpux*) + SHLEXT=sl + SH_LDFLAGS="-shared -fPIC" + RLD_FLAG='-Xlinker +b -Xlinker $(shell cd $(LIB_BUILD_DIR); pwd)' + ;; + sparc-sun-solaris2* | i386-pc-solaris2*) + RLD_FLAG='-Xlinker -R -Xlinker $(shell cd $(LIB_BUILD_DIR); pwd)' + ;; + *) + if $SHARED_LIBS; then + AC_MSG_ERROR([I don't know how to handle this machine. Correct me first!]) + fi + ;; +esac + +if $use_rpath; then + true +else + RLD_FLAG= +fi + +AC_SUBST(CCFLAGS) +AC_SUBST(CCPICFLAG) +AC_SUBST(SHLEXT) +AC_SUBST(STLEXT) +AC_SUBST(SH_LD) +AC_SUBST(SH_LDFLAGS) +AC_SUBST(SONAME_FLAGS) +AC_SUBST(RLD_FLAG) +AC_SUBST(EXECEXT) + +dnl Set CC and LD variable + +LD=$CC +AC_SUBST(LD) + +dnl Generate ouputs + +AC_OUTPUT( +[ Makeconf + Makefile + Makerule + src/viterbiversion.t + src/Makefile + test/Makefile +]) + +AC_OUTPUT_COMMANDS( + LIBVITERBI_CHECK_CHANGE("src/viterbiversion.h", "src/viterbiversion.t") +) diff --git a/configure.in b/configure.in deleted file mode 100644 index 9690212..0000000 --- a/configure.in +++ /dev/null @@ -1,266 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. - -AC_INIT(src/trellis.h) - -AC_CANONICAL_HOST - -dnl Generate config.h - -dnl Minimum Autoconf version required. -AC_PREREQ(2.10) - -dnl Version code -V_MAJOR=1 -V_MINOR=2 -V_MICRO=0 - -VERSION=${V_MAJOR}.${V_MINOR}.${V_MICRO} -AC_SUBST(VERSION) - -dnl Package name -PACKAGE=viterbi -AC_SUBST(PACKAGE) - -dnl Library name -LIBRARY=viterbi -AC_SUBST(LIBRARY) - -dnl Check C compiler - -AC_PROG_CC - -dnl Check compileur options - -OLDCCFLAGS="$CCFLAGS" -CCFLAGS="" -LIBVITERBI_CC_FLAG(-O3) -if test "$libviterbi_cv_cc_flag__O3" = "no"; then - LIBVITERBI_CC_FLAG(-O2) - if test "$libviterbi_cv_cc_flag__O2" = "no"; then - CCFLAGS="$OLDCCFLAGS" - fi -fi - -LIBVITERBI_CC_FLAG(-pipe) - -LIBVITERBI_CC_FLAG(-Wall) - -dnl Checks for programs. - -AC_PROG_INSTALL -AC_PROG_MAKE_SET -AC_PROG_LN_S -AC_PROG_RANLIB - -AC_CHECK_PROGS(AR, ar) -if test "$AR" = ""; then - if $STATIC_LIBS; then - AC_MSG_ERROR([Unable to found ar]); - fi -fi -AC_SUBST(AR) - -AC_CHECK_PROGS(STRIP, strip) -if test "$STRIP" = ""; then - AC_MSG_WARN([Unable to found strip]); -fi -AC_SUBST(STRIP) - -AC_CHECK_PROGS(BASENAME, basename) -if test "$BASENAME" = ""; then - AC_MSG_ERROR([Unable to found basename]); -fi -AC_SUBST(BASENAME) - -AC_CHECK_PROGS(TAR, gtar tar) -if test -z "$TAR"; then - AC_MSG_WARN([Unable to found tar]); -fi -AC_SUBST(TAR) - -AC_CHECK_PROGS(COMPRESS, bzip2 gzip compress) -if test -z "$COMPRESS"; then - AC_MSG_WARN([Unable to found compress]); -fi -AC_SUBST(COMPRESS) - -dnl Checks for libraries. - -dnl Checks for header files. - -dnl Checks for typedefs, structures, and compiler characteristics. - -dnl Check options - -### Usage of a temporary directory - -BUILD_DIR="build" -AC_ARG_ENABLE(builddir, - [ --enable-builddir= use for object files], - [case "$enableval" in - no) - ;; - yes) - BUILD_DIR="/tmp/`whoami`/$PACKAGE" - ;; - *) - BUILD_DIR="$enableval" - ;; - esac], []) -changequote(,)dnl -BUILD_DIR=`echo $BUILD_DIR | sed -e 's%^\([^/]\)%$(top_srcdir)/\1%'` -changequote([,])dnl -AC_SUBST(BUILD_DIR) - -### Enable creation of static libraries. - -AC_ARG_ENABLE(static, - [ --enable-static create static libraries], - [if test "$enableval" = no; then STATIC_LIBS=false; - else STATIC_LIBS=true; fi], - STATIC_LIBS=true) -AC_SUBST(STATIC_LIBS) - -### enable debugging information - -AC_ARG_WITH(debug, - [ --with-debug add debug information], - [if test "$withval" = no; then DEBUG=false; - else DEBUG=true; fi], - DEBUG=false) -AC_SUBST(DEBUG) - -### with profiling information - -AC_ARG_WITH(profile, - [ --with-profile add profiling information (for gprof)], - [if test "$withval" = no; then PROFILE=false; - else PROFILE=true; fi], - PROFILE=false) - -if test "$PROFILE" = true; then - DEBUG=true -fi - -## check debugging flags - -if test "$DEBUG" = true; then - LIBVITERBI_CC_FLAG(-ggdb3) - if test "$libviterbi_cv_cc_flag__ggdb3" = "no"; then - LIBVITERBI_CC_FLAG(-g) - if test "$libviterbi_cv_cc_flag__g" = "no"; then - AC_MSG_ERROR([Can't add debugging information with this compiler!]) - fi - fi -fi - -## check profiling flags - -if test "$PROFILE" = true; then - LIBVITERBI_CC_LDFLAG(-pg) - if test "$libviterbi_cv_cc_ldflag__pg" = "no"; then - AC_MSG_ERROR([Can't add profiling information with this compiler!]) - fi -fi - -### Enable creation of shared libraries. Currently only works with -### gcc on some systems. - -AC_ARG_ENABLE(shared, - [ --enable-shared create shared libraries (not all systems)], - [if test "$enableval" = no; then SHARED_LIBS=false; - else SHARED_LIBS=true; fi], - SHARED_LIBS=true) -AC_SUBST(SHARED_LIBS) - -dnl Some check for cygwin - -case "$host" in - *-*-cygwin*) - SHARED_LIBS=false - ;; -esac - -if $STATIC_LIBS || $SHARED_LIBS; then - true -else - AC_MSG_ERROR([You can't disable building static AND shared libraries!]) -fi - -### - -use_rpath=true -AC_ARG_ENABLE(rpath, - [ --enable-rpath add -rpath to link command for shared libraries], - [if test "$enableval" = no; then use_rpath=false; fi], []) - -CCPICFLAG=-fPIC -SHLEXT=so -STLEXT=a -SH_LD="$CC" -SH_LDFLAGS=-shared -SONAME_FLAGS= -RLD_FLAG= -EXECEXT="" -case "$host" in - *-*-386bsd* | *-*-openbsd* | *-*-netbsd* | *-*-freebsd*) - SH_LD=ld - SH_LDFLAGS=-Bshareable - ;; - *-*-cygwin*) - EXECEXT=".exe" - ;; - *-*-linux*) - SONAME_FLAGS='-Xlinker -soname -Xlinker $(shell $(BASENAME) $@)' - RLD_FLAG='-Xlinker -rpath -Xlinker $(shell cd $(LIB_BUILD_DIR); pwd)' - ;; - hppa*-hp-hpux*) - SHLEXT=sl - SH_LDFLAGS="-shared -fPIC" - RLD_FLAG='-Xlinker +b -Xlinker $(shell cd $(LIB_BUILD_DIR); pwd)' - ;; - sparc-sun-solaris2* | i386-pc-solaris2*) - RLD_FLAG='-Xlinker -R -Xlinker $(shell cd $(LIB_BUILD_DIR); pwd)' - ;; - *) - if $SHARED_LIBS; then - AC_MSG_ERROR([I don't know how to handle this machine. Correct me first!]) - fi - ;; -esac - -if $use_rpath; then - true -else - RLD_FLAG= -fi - -AC_SUBST(CCFLAGS) -AC_SUBST(CCPICFLAG) -AC_SUBST(SHLEXT) -AC_SUBST(STLEXT) -AC_SUBST(SH_LD) -AC_SUBST(SH_LDFLAGS) -AC_SUBST(SONAME_FLAGS) -AC_SUBST(RLD_FLAG) -AC_SUBST(EXECEXT) - -dnl Set CC and LD variable - -LD=$CC -AC_SUBST(LD) - -dnl Generate ouputs - -AC_OUTPUT( -[ Makeconf - Makefile - Makerule - src/viterbiversion.t - src/Makefile - test/Makefile -]) - -AC_OUTPUT_COMMANDS( - LIBVITERBI_CHECK_CHANGE("src/viterbiversion.h", "src/viterbiversion.t") -)